package com.lanjiu.lib.imclient.dto;

import com.lanjiu.pro.business.BusinessProtocolEntities;
import com.lanjiu.lib.imclient.dto.base.Dto;

/**
 * @description: 搜索
 * @author: Panwei
 * @date: 2019/11/14 21:22
 */
public class SearchDto extends Dto {

    // 搜索条件
    private String keyword;

    public SearchDto() {
    }

    public String getKeyword() {
        return keyword;
    }

    public void setKeyword(String keyword) {
        this.keyword = keyword;
    }

    public SearchDto(BusinessProtocolEntities.Search search) {
        this.keyword = search.getKeyword();
    }

    @Override
    public BusinessProtocolEntities.Search toProtobuf() {
        BusinessProtocolEntities.Search.Builder builder = BusinessProtocolEntities.Search.newBuilder();
        if (null != keyword) builder.setKeyword(keyword);
        return builder.build();
    }
}
